$clear @s *[custom_data~{id:"voidogen"}] $(needCount)
playsound block.note_block.bell master @a ~ ~ ~ 0.8

execute if data entity @n[tag=seller,distance=..500,type=item_display] item.components."minecraft:custom_data".void_shop{give:false} run return fail

$execute anchored eyes run loot spawn ^ ^ ^ loot $(loot_table)
execute anchored eyes positioned ^ ^ ^ run tag @n[type=item,distance=..1,nbt={Age:0s}] add VSTradeTempItemEntity
execute anchored eyes positioned ^ ^ ^ run tag @n[type=item,distance=..1,nbt={Age:0s}] add TradeItem
execute anchored eyes positioned ^ ^ ^ run data modify entity @n[type=item,distance=..100,tag=VSTradeTempItemEntity] PickupDelay set value 0s

data modify entity @n[tag=VSTradeTempItemEntity,type=item,distance=..100] Owner set from entity @p[tag=buyer] UUID



tag @n[type=item,distance=..100,tag=VSTradeTempItemEntity] add VSTradeTempItemEntity